import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import(/* webpackChunkName: "home" */ '@/views/Home/index.vue')
  },
  {
    path: '/home/:id',
    name: 'Forum',
    component: () => import(/* webpackChunkName: "forum" */ '@/views/Forum/index.vue')
  },
  {
    path: '/article/:id',
    name: 'Article',
    component: () => import(/* webpackChunkName: "article" */ '@/views/Article/index.vue')
  },
  {
    path: '/accountCenter',
    name: 'AccountCenter',
    redirect: '/accountCenter/postList',
    component: () => import(/* webpackChunkName: "accountCenter" */ '@/views/AccountCenter/index.vue'),
    children: [
      {
        path: 'postList',
        component: () => import(/* webpackChunkName: "accountCenter" */ '@/views/AccountCenter/postList.vue')
      },
      {
        path: 'replyList',
        component: () => import(/* webpackChunkName: "accountCenter" */ '@/views/AccountCenter/replyList.vue')
      },
      {
        path: 'bookList',
        component: () => import(/* webpackChunkName: "accountCenter" */ '@/views/AccountCenter/bookList.vue')
      },
      {
        path: 'fanList',
        component: () => import(/* webpackChunkName: "accountCenter" */ '@/views/AccountCenter/fanList.vue')
      },
      {
        path: 'followList',
        component: () => import(/* webpackChunkName: "accountCenter" */ '@/views/AccountCenter/followList.vue')
      },
      {
        path: 'level',
        component: () => import(/* webpackChunkName: "accountCenter" */ '@/views/AccountCenter/level.vue')
      },
      {
        path: 'miyob',
        component: () => import(/* webpackChunkName: "accountCenter" */ '@/views/AccountCenter/miyob.vue')
      },
      {
        path: 'certification',
        component: () => import(/* webpackChunkName: "accountCenter" */ '@/views/AccountCenter/certification.vue')
      },
      {
        path: 'privacy',
        component: () => import(/* webpackChunkName: "accountCenter" */ '@/views/AccountCenter/privacy.vue')
      },
      {
        path: 'edit',
        component: () => import(/* webpackChunkName: "accountCenter" */ '@/views/AccountCenter/edit.vue')
      },
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
